/**
 * 仿照element-ui的button组件，采用jsx语法
 * slots
 * -- default 自定义内容，参数为 { type }
 */
import { defineComponent, renderSlot } from 'vue'
import './style.scss'

export default defineComponent({
  name: 'vc-button',
  props: {
    //暂不实现，太麻烦
    type: {
      type: String,
      default: 'default'
    },
  },
  setup(props, context) {
    return () => {
      return (
        <button type="button" class={['vc-button', `vc-button--${props.type}`]}>
          <span>
            {
              renderSlot(context.slots, 'default', {
                type: props.type  //插槽内传参
              })
            }
          </span>
        </button>
      )
    }
  }
})